package cn.xuewenbao.edu.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 学习记录
 * </p>
 *
 * @author liubf
 * @since 2021-09-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="学习记录对象", description="学习记录表")
public class LearnRecord implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "内容id")
    private String contentId;

    @ApiModelProperty(value = "专栏类型，1代表文章，2代表课程，3代表期刊，4讲书")
    private String columnType;

    @ApiModelProperty(value = "仅课程中的章节编号; 讲书中的视频音频标志位")
    private String contentSubject;

    @ApiModelProperty(value = "内容播放进度, 单位s(视频、音频), 可回放到已学习的部分")
    @TableField("`current_time`")
    private Double currentTime;

    @ApiModelProperty(value = "内容总时长, 单位s(视频、音频)")
    private Double totalTime;

    @ApiModelProperty(value = "已学习的最大内容时长, 单位s(视频、音频), 通过learnedTime/totalTime记录学习进度百分比")
    private Double learnedTime;

    @ApiModelProperty(value = "用户id")
    private String userId;

    @ApiModelProperty(value = "内容的作者id")
    private String authorId;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;


}
